//
//  KZReviewClassTitleCell.m
//  lg_zhinengbeikao_english
//
//  Created by 朱凯 on 2019/1/8.
//  Copyright © 2019 zhukai. All rights reserved.
//

#import "KZReviewClassTitleCell.h"

@implementation KZReviewClassTitleCell
{
    UILabel *_titleLabel;            // 进度
}

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        
        [self setupUI];
    }
    return self;
}
- (void)setupUI {
    
    UIView *line = [UIView new];
    line.layer.cornerRadius = 2;
    line.backgroundColor = kBlueColor;
    [self.contentView addSubview:line];
    [line mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(W(10));
        make.width.mas_equalTo(W(4));
        make.height.mas_equalTo(H(20));
        make.top.mas_equalTo(H(10));
        // 设置cell高度
        make.bottom.mas_equalTo(H(-10));
    }];
    
    
    _titleLabel = [[UILabel alloc] init];
    _titleLabel.text = @"热门试卷";
    _titleLabel.font = FONT(16);
    _titleLabel.textAlignment = NSTextAlignmentCenter;
    _titleLabel.textColor = UIColor.blackColor;
    [self.contentView addSubview:_titleLabel];
    [_titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(line.mas_right).offset(W(5));
        make.centerY.equalTo(line);
    }];
    
    UIImageView *arrowView = [UIImageView new];
    arrowView.image = [UIImage imageNamed:@"kz-右箭头"];
    [self.contentView addSubview:arrowView];
    [arrowView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.width.height.mas_equalTo(W(15));
        make.right.mas_equalTo(W(-15));
        make.centerY.equalTo(line);
    }];

    UILabel *moreLabel = [[UILabel alloc] init];
    moreLabel.text = @"更多";
    moreLabel.font = FONT(14);
    moreLabel.textAlignment = NSTextAlignmentRight;
    moreLabel.textColor = UIColor.lightGrayColor;
    [self.contentView addSubview:moreLabel];
    [moreLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.right.equalTo(arrowView.mas_left).offset(W(-5));
        make.centerY.equalTo(line);
    }];
}
@end
